﻿using NicoView.ViewModel;
using NicoView.ViewModel.Message;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NicoView.View.Behaviors
{
    public class CommentShowAction:ShowWindowAction<NicoViewCommentShowWindow>
    {


        protected override void OnInvoke(object msg)
        {
            NicoViewCommentCollection comments = new NicoViewCommentCollection();

            var message = (NicoViewCommentShowCommentMessage)msg;
            foreach (var comment in message.Comments)
            {
                comments.Add(comment);
            }
            var viewModel = new NicoViewCommentShowViewModel();
            viewModel.AddComments(comments);

            this.Target.DataContext = viewModel;
        }
    }
}
